package com.xiaoxu.intranetweb.mybatisplusSzappdb.controller.icCard;

import cn.dev33.satoken.stp.StpUtil;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.business.icCard.IcCardAdvancedBu;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.dao.UserInfoDao;
import com.xiaoxu.intranetweb.util.PermissionCheck;
import com.xiaoxu.intranetweb.util.SzResult;
import com.xiaoxu.intranetweb.util.WebFunctionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/icCardAdvanced")
public class icCardAdvancedController {
    @Autowired
    private IcCardAdvancedBu icCardAdvancedBu;
    @Autowired
    private UserInfoDao userInfoDao;
    @Autowired
    private WebFunctionUtil webFunctionUtil;
    @GetMapping("/icCardAdvanced")
    @PermissionCheck("icCardAdvanced_icCardAdvanced")
    public SzResult icCardAdvanced(@RequestParam String id,
                                   @RequestParam(value = "cardInfExcuseTareStatus", required = false) String cardInfExcuseTareStatus,//是否免皮重
                                   @RequestParam(value = "cardInfTareNum", required = false) String cardInfTareNum,//免过皮重(吨)
                                   @RequestParam(value = "cardInfPutOutedStatus", required = false) String cardInfPutOutedStatus,//ic卡是否发放
                                   @RequestParam(value = "cardInfReportLostStatus", required = false) String cardInfReportLostStatus,//ic卡是否挂失
                                   @RequestParam(value = "cardInfCurValidStatus", required = false) String cardInfCurValidStatus,//ic卡是否有效
                                   HttpServletRequest request) throws Exception {
        String token = request.getHeader("Authorization");
        String plantId = request.getHeader("Plant-Id");
        return icCardAdvancedBu.IcCardAdvanced(id, cardInfExcuseTareStatus, cardInfTareNum, cardInfPutOutedStatus, cardInfReportLostStatus, cardInfCurValidStatus, token,plantId);
    }
}
